<#escape x as (x)!?html>
<head>
    <script type="text/javascript">
        var menuId = "Settings_User";
        function updateUser(e) {
            $.ajax({
                type: "POST",
                url: "edit!ajaxSubmit.action",
                data: $("#mainForm").serialize(),
                dataType :"json",
                success: function(echo) {
                    if (echo.result == true) {
                        showTip(e, "Save success！");
                    } else {
                        showTip(e, echo.result);
                    }
                },
                async: false
            });
        }
    </script>
</head>
<body>
<form id="mainForm">
    <input type="hidden" name="userName" value="${user.name}"/>
    <table>
        <caption>
            <div class="tools border">UserName: ${user.name}</div>
        </caption>
    </table>

    <fieldset>
        <legend>
            <span class="title">Other: </span>
        </legend>
        <table class="property_table">
            <tr>
                <td class="key"><input type="checkbox" name="roleNames"
                                       value="ADMIN" ${user.hasRole("ADMIN")?string("checked","")}/>Administrator&nbsp;
                </td>
            </tr>
        </table>
    </fieldset>

    <input type="button" value="Save" class="btn" onclick="updateUser($(this))"/>
    <input type="button" value="Back" class="btn" onclick="window.location.href='list.action'"/>
</form>
</body>
</#escape>